#!/usr/bin/perl

require "segmenter.pl";

die if $#ARGV == -1;

$outfile = $ARGV[0];
$outfile =~ s/\..+$/\.seg/i;
open(OUT, "> $outfile") or die "Can't open segmentation output file\n";
open(TXT, $ARGV[0]) or die "Can't open input file.\n";

while ($line = <TXT>) {
    print OUT segmentline($line);
}
close(TXT);
close(OUT);
